package com.itheima.mapper;


import com.github.pagehelper.Page;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.pojo.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper {


    Page<Order> page(QueryPageBean queryPageBean);

    void update(Integer id);

    @Select("select count(id) from t_order where orderDate = #{today}")
    Integer orderCountByDate(String today);

    @Select("select count(id) from t_order where orderDate > #{monday}")
    Integer orderCountByWeek(String monday);

    @Select("select count(id) from t_order where orderDate > #{month}")
    Integer orderCountByMonth(String month);

    @Select("select count(id) from t_order where orderDate = #{today} and orderStatus = '已到诊'")
    Integer visitCountByDate(String today);

    @Select("select count(id) from t_order where orderDate > #{monday} and orderStatus = '已到诊'")
    Integer visitMemberCountByWeek(String monday);

    @Select("select count(id) from t_order where orderDate > #{month} and orderStatus = '已到诊'")
    Integer visitMemberCountByMonth(String month);

    List<Map> gethotSetmeal();
}
